package com.elec.controller.end;

import com.elec.domain.R;
import com.elec.domain.entity.AnalysisReport;
import com.elec.service.AnalysisReportService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author yu
 * @date 2024/7/6
 */
@RestController
@RequestMapping("end/analysisReport")
public class AnalysisReportController {
    @Resource
    private AnalysisReportService analysisReportService;
    @PostMapping
    public R add(@RequestBody AnalysisReport analysisReport){
        return analysisReportService.add(analysisReport);
    }
    @DeleteMapping("{id}")
    public R delete(@PathVariable("id") Long id){
        return analysisReportService.delete(id);
    }
    @GetMapping("{id}")
    public R get(@PathVariable("id") Long id){
        return analysisReportService.get(id);
    }
    @GetMapping("list")
    public R getList(@RequestParam(defaultValue = "1") Integer pageNum,
                     @RequestParam(defaultValue = "10") Integer pageSize,
                     AnalysisReport analysisReport){
        return analysisReportService.getList(pageNum,pageSize,analysisReport);
    }
    @PutMapping
    public R update(@RequestBody AnalysisReport analysisReport){
        return analysisReportService.update(analysisReport);
    }
}
